#ifndef _HELLO_H_
#define _HELLO_H_

#include <windows.h>
#include <afxwin.h>


#define DT_LONG  100
#define POSITION_X  50  
#define POSITION_Y  50



struct Block{
	int sNum; 
};


struct Information{
	CString sTitle;
	CString sNum;
};




class CMyApp: public CWinApp
{
public:
	virtual BOOL InitInstance();
};

class CMainWindow : public CFrameWnd
{
public:
	CMainWindow();
	void DrawRect(CDC *pdc,int x1,int y1,Information info,Block block);


	int findIndex(int i);
	Block findMax(Block *b);
	int CountAll(Block *b);




	BOOLEAN  isNorthEnable();
	BOOLEAN  isSouthEnable();
	BOOLEAN  isWestEnable();
	BOOLEAN  isEastEnable();
	BOOLEAN  isEnable(Block *b);



	void MoveUp();
	void MoveDown();
	void MoveLeft();
	void MoveRight();
	void Move(Block *b);



	void NewBlock();
	int  FindAllZero();

	BOOLEAN isGameOver();



protected:
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void CMainWindow::OnChar(UINT nChar,UINT nRepCnt,UINT nFlags);
	DECLARE_MESSAGE_MAP()
};




#endif